#include "gl_validation.hpp"

const char *gl_err_string(GLenum err) {
#define CASE(x) \
    case x:     \
        return #x
    switch (err) {
        CASE(GL_NO_ERROR);
        CASE(GL_INVALID_ENUM);
        CASE(GL_INVALID_VALUE);
        CASE(GL_INVALID_OPERATION);
        CASE(GL_STACK_OVERFLOW);
        CASE(GL_STACK_UNDERFLOW);
        CASE(GL_OUT_OF_MEMORY);
        CASE(GL_INVALID_FRAMEBUFFER_OPERATION);
        default:
            return "Unknown Error!";
    }
}
